//
//  OrderHeaderView.m
//  YIChuSeller
//
//  Created by xsj on 2018/11/23.
//  Copyright © 2018年 xiangshengjun. All rights reserved.
//

#import "GXOrderHeaderView.h"
@interface GXOrderHeaderView ()
@property (strong, nonatomic) IBOutlet UIView *lineView;
@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *buttonArrays;

@end
@implementation GXOrderHeaderView

- (void)awakeFromNib
{
    [super awakeFromNib];
    [self setStyle];
}
- (void)setStyle{
    for (UIButton * button in self.buttonArrays) {
        [button setTitleColor:RGBColor(184, 232, 228) forState:UIControlStateNormal];
        [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
        UIView * view = [self viewWithTag:button.tag+10];
        [view setHidden:YES];
        if (button.tag == 101) {
            button.selected = YES;
            [view setHidden:NO];
        }
    }
}
+(instancetype)headView
{
    return [[NSBundle mainBundle]loadNibNamed:@"GXOrderHeaderView" owner:nil options:nil].lastObject;
}
- (IBAction)pressBtn:(UIButton *)sender {
    for (UIButton * button in self.buttonArrays) {
        button.selected = NO;
        UIView * view = [self viewWithTag:button.tag+10];
        [view setHidden:YES];
    }
    sender.selected = YES;
    UIView * view = [self viewWithTag:sender.tag+10];
    [view setHidden:NO];
    if ([self.delegate respondsToSelector:@selector(pressButtonChangeViewForTag:)]) {
        [self.delegate pressButtonChangeViewForTag:sender.tag];
    }
}

@end
